﻿using System;
using System.Web;
using System.Web.Caching;

namespace InhollandAir
{
    public class Country
    {
        public int Id { get; set; }
        public string Name { get; set; }

        public static Country CreateCountryWith(int id, string name)
        {
            var country = new Country
                {
                    Id = id,
                    Name = name
                };

            return country;
        }
    }

    public class Airplane
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public double Price { get; set; }
        public int Capacity { get; set; }
    }

    public class Airport
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string ShortName { get; set; }
        public Country Country { get; set; }

        public static Airport CreateAirportWith(int id, string name)
        {
            var airport = new Airport {Id = id, Name = name};
            return airport;
        }

        public static Airport CreateAirportWith(int id, string name, string shortName, Country country)
        {
            var airport = CreateAirportWith(id, name);
            airport.ShortName = shortName;
            airport.Country = country;

            return airport;
        }
    }

    public class Route
    {
        public int Id { get; set; }
        public Airport From { get; set; }
        public Airport To { get; set; }

        public static Route CreateRouteWith(int id, Airport from, Airport to)
        {
            var route = new Route {Id = id, From = from, To = to};
            return route;
        }
    }

    public class Flight
    {
        public int Id { get; set; }
        public Route Route { get; set; }
        public DateTime StartDate { get; set; }

        public static Flight CreateFlightWith(int id, Route route, DateTime startDate)
        {
            var flight = new Flight {Id = id, Route = route, StartDate = startDate};
            return flight;
        }
    }

    public class Address
    {
        public readonly int Id;

        public Address(int id)
        {
            Id = id;
        }

        public Country Country { get; set; }
        public string Zipcode { get; set; }
        public int HouseNumber { get; set; }
        public string HouseNumberSuffix { get; set; }
    }
}